package com.skt.domain.VO;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商家订单视图对象（VO）
 *
 * 说明：
 * - 用于商家查询自己的订单列表（GET /merchant/orders）
 * - 所有用户敏感信息（如手机号）均已脱敏
 * - 时间字段说明：
 *     - scheduled：用户下单时预约的时间
 *     - actual：系统实际记录的时间（可能为空）
 */
@Data
@Accessors(chain = true)
@Schema(description = "商家订单信息（用户信息已脱敏）")
public class MerchantOrderVO {

    @Schema(description = "订单ID", example = "1001")
    private Long id;

    @Schema(description = "订单编号（全局唯一）", example = "ORD20251020123456")
    private String orderNo;

    @Schema(description = "租客昵称（已脱敏，非真实姓名）", example = "用户_138****")
    private String customerName;

    @Schema(description = "租客手机号（已脱敏）", example = "138****1234")
    private String customerPhone;

    @Schema(description = "租赁服装名称", example = "唐代齐胸襦裙")
    private String costumeName;

    @Schema(description = "租赁天数", example = "3")
    private Integer rentalDays;

    @Schema(description = "日租金（元）", example = "50.00")
    private BigDecimal dailyRentalPrice;

    @Schema(description = "总租金 = 日租金 × 天数（元）", example = "150.00")
    private BigDecimal totalRentalPrice;

    @Schema(description = "实付金额（元，可能含优惠或押金抵扣）", example = "130.00")
    private BigDecimal actualAmount;

    @Schema(
        description = "订单状态：1-待付款，2-已付款，3-已租出，4-已归还，5-已完成，6-已取消",
        example = "3"
    )
    private Byte status;

    @Schema(description = "预约租借开始时间", example = "2025-10-25T10:00:00")
    private LocalDateTime scheduledStartTime;

    @Schema(description = "预约租借结束时间", example = "2025-10-28T10:00:00")
    private LocalDateTime scheduledEndTime;

    @Schema(description = "实际租出时间（可能为空）", example = "2025-10-25T14:30:00")
    private LocalDateTime actualStartTime;

    @Schema(description = "实际归还时间（可能为空）", example = "2025-10-28T09:15:00")
    private LocalDateTime actualReturnTime;

    @Schema(description = "订单创建时间", example = "2025-10-20T19:00:00")
    private LocalDateTime createdAt;

    @Schema(description = "最后更新时间", example = "2025-10-25T14:30:00")
    private LocalDateTime updatedAt;
}